package com.ttl.web.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ttl.web.entity.Goods;
import com.ttl.web.entity.GoodsPage;
import com.ttl.web.mapper.GoodsMapper;
import com.ttl.web.service.GoodsService;
import org.springframework.stereotype.Service;

@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
    public GoodsServiceImpl() {}

    @Override
    public IPage<Goods> getMyCollect(GoodsPage param) {
        // 构造分页对象
        IPage<Goods> page = new Page<Goods>(param.getCurrentPage(), param.getPageSize());
        // 查询收藏的商品
        return this.baseMapper.getMyCollect(page, param.getUserId());
    }
}
